/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Clases;

import java.util.ArrayList;

/**
 *
 * @author hC4stillo
 */
public class Comun {
    public ArrayList<Object> x;
    public ArrayList<Object> y;
    Comun(ArrayList<Object> x, ArrayList<Object> y)
    {
        this.x=x;
        this.y=y;
    }
    public ArrayList<Object> getXCuadrado()
    {
        ArrayList<Object> xCuadrado = new ArrayList();
        for(int i = 0;i<x.size();i++)
            xCuadrado.add(Math.pow(Float.parseFloat(this.x.get(i).toString()), 2));
        return xCuadrado;
    }
    public ArrayList<Object> getYCuadrado()
    {
        ArrayList<Object> yCuadrado = new ArrayList();
        for(int i = 0;i<y.size();i++)
            yCuadrado.add(Math.pow(Float.parseFloat(this.y.get(i).toString()), 2));
        return yCuadrado;
    }
    public ArrayList<Object> getXPorY()
    {
        ArrayList<Object> xPorY = new ArrayList();
        for(int i =0;i<x.size();i++)
            xPorY.add(Integer.parseInt(this.x.get(i).toString())*Float.parseFloat(this.y.get(i).toString()));
        return xPorY;
    }
    public float reducirDecimales(float valor)
    {
        valor = valor*10000;
        valor = java.lang.Math.round(valor);
        valor = valor/10000;
        return valor;
    }


}
